package main
import (
	"fmt"
	"log"
	"gopkg.in/yaml.v2"
	myaml "github.com/ghodss/yaml"
	"io/ioutil"
	"encoding/json"
)
func main() {
	yamlContent,_ := ioutil.ReadFile("ubuntu.yaml")

        jStr,_ := myaml.YAMLToJSON(yamlContent)

	ioutil.WriteFile("tt.yaml",[]byte(jStr),0x666)



	result := make(map[string]interface{})
	err := yaml.Unmarshal([]byte(yamlContent), &result)
	if err != nil {
		log.Fatalf("error: %v", err)
	}
	fmt.Println(result["kind"])
        js ,err :=	json.Marshal(result)
        if err!=nil {	
	fmt.Println(result["metadata"])
        }
	fmt.Println(string(js))
}


